#ifndef AVIATION_RESERVATIONSYSTEM_H
#define AVIATION_RESERVATIONSYSTEM_H

#include "customer.h"
#include "flight.h"
#include "reservation.h"
#include "user.h"

#include "database.h"

#include <string>

#include <map>

#include <exception>

#include <iostream>
#include <fstream>

#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>

#include <boost/serialization/set.hpp>
#include <boost/serialization/string.hpp>

#include <boost/serialization/nvp.hpp>

namespace aviation
{

/// This class aggregates our databases and controls file IO.
struct ReservationSystem
{
	typedef Database<Customer>		CustomerDatabase;
	typedef Database<Flight>		FlightDatabase;
	typedef Database<Reservation>	ReservationDatabase;
	typedef Database<User>			UserDatabase;

	CustomerDatabase	customerDB;
	FlightDatabase		flightDB;
	ReservationDatabase	reservationDB;
	UserDatabase		userDB;

	/// Nontrivial constructor.
	/// Reads in previously serialized databases, plus FCGDATA file.
	ReservationSystem();
	/// Nontrivial destructor.
	/// Saves current state by serializing all databases.
	~ReservationSystem();

private:

	// Disable copying and assignment.

	ReservationSystem(const ReservationSystem& other);
	ReservationSystem& operator=(const ReservationSystem& other);
};

} // namespace aviation

#endif // AVIATION_RESERVATIONSYSTEM_H